<template>
  <view>
    <view class="details">
      <text class="title">奖励名称: {{ jlName }}</text>
      <text>时间: {{ jlDate }}</text>
      <text>事由: {{ reason }}</text>
      <text>等级: {{ jlLevel }}</text>
      <text>描述: {{ describe || "无" }}</text>
    </view>
  </view>
</template>

<script>
import { getReward } from "@/api/work/reward";

export default {
  data() {
    return {
      jlName: "",
      jlDate: "",
      reason: "",
      jlLevel: "",
      describe: "",
    };
  },
  onLoad(options) {
    const id = options.id;
    this.fetchDetails(id);
  },
  methods: {
    fetchDetails(id) {
      getReward(id).then((response) => {
        const data = response.data;
        this.jlName = data.jlName;
        this.jlDate = data.jlDate;
        this.reason = data.reason;
        this.jlLevel = data.jlLevel;
        this.describe = data.describe || "无";
      });
    },
  },
};
</script>

<style scoped>
/* 页面整体样式 */
view {
  padding: 20px;
  background-color: #f5f5f5;
}

/* 返回按钮样式 */
.back-button {
  font-size: 16px;
  color: #007aff;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
}

/* 详情内容样式 */
.details {
  background-color: #ffffff;
  padding: 15px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* 文字样式 */
text {
  display: block;
  font-size: 16px;
  color: #333;
  margin-bottom: 10px;
}

/* 加粗的标题 */
.title {
  font-weight: bold;
  font-size: 18px;
  margin-bottom: 15px;
}
</style>
